package com.xiaofeng.pochi.exception;

import com.xiaofeng.pochi.enums.ResultEnums;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/07/07/23:35
 * @Description: 自定义异常
 */
public class PochiException extends RuntimeException{

    private Integer errCode = ResultEnums.ERROR.getCode();

    public PochiException(ResultEnums resultEnums) {
        super(resultEnums.getMsg());
        this.errCode = resultEnums.getCode();
    }


    public PochiException(ResultEnums resultEnums, Throwable throwable) {
        super(resultEnums.getMsg(), throwable);
        this.errCode = resultEnums.getCode();
    }

    public PochiException(String msg) {
        super(msg);
    }
    public PochiException(Integer code, String msg) {
        super(msg);
        this.errCode = code;
    }

    public PochiException(Throwable throwable) {
        super(throwable);
    }

    public Integer getErrCode() {
        return errCode;
    }

    public void setErrCode(Integer errCode) {
        this.errCode = errCode;
    }
}
